package com.shicijiaoliu.mapper;

import com.shicijiaoliu.pojo.Section;
import org.apache.ibatis.annotations.*;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface Sectionmapper {
    int getcount(String name,LocalDateTime createtime, LocalDateTime updatetime);

    List<Section> findBypage(String name,LocalDateTime createtime, LocalDateTime updatetime);

    @Select("select * from section where name=#{name}")
    Section findByname(String name);

    @Delete("delete from section where s_id=#{id}")
    void delByid(long id);

    @Insert("insert into section (name, sd, a_id,create_time,update_time) " +
    " value (#{name},#{sd},#{aId},#{createTime},#{updateTime})")
    void add(Section section);

    @Select("select * from section where s_id=#{id}")
    Section findByid(long id);

    @Update("update section set name=#{name},sd=#{sd},update_time=#{updateTime} where s_id=#{sId}")
    void update(Section section);
}
